home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / Aidan's Class Libraries / Source / Headers / CLCleanup.h < prev    next >
Encoding:
Text File  |  1997-05-24  |  706 b   |  45 lines  |  [TEXT/CWIE]

  1. //Copyright (c) 1997 Aidan Cully
  2. //All rights reserved
  3.  
  4. #ifndef __CLEANUP_H
  5. #define __CLEANUP_H
  6.  
  7. #include <Types.h>
  8. #include "CLQueue.h"
  9.  
  10. typedef Boolean (*CleanupProc)( UInt32, void* );
  11.  
  12. enum {
  13.     kSuccess = 0,
  14.     kDuplicateActionErr = 1,
  15.     kActionNotFoundErr = 2,
  16.     kActionLocalErr = 3,
  17.     kCleanupMemErr = 255
  18. };
  19.  
  20. class TCleanup
  21. {
  22. protected:
  23.     class TProcEl
  24.     {
  25.     public:
  26.         UInt32 mProcID;
  27.         CleanupProc mProc;
  28.     };
  29.     class TDataEl
  30.     {
  31.     public:
  32.         UInt32 mProcID;
  33.         void *mData;
  34.     };
  35.     TQueue<TDataEl*> mQueue;
  36.     TList<TProcEl*> mProcs;
  37. public:
  38.     virtual ~TCleanup();
  39.     UInt8 RegisterDirtyAction( UInt32, CleanupProc );
  40.     UInt8 UnregisterDirtyAction( UInt32 );
  41.     UInt8 NotifyDirty( UInt32, void* );
  42.     UInt8 Clean();
  43. };
  44.  
  45. #endif